<?php
session_start();
include "../config.php";
$name=$_POST['name'];
$addr=$_POST['addr'];
$tel=$_POST['tel'];
$email=$_POST['email'];
$userId=$_SESSION['home_userid'];

$sql="insert into relation (name,addr,tel,email,user_id) values ('{$name}','{$addr}','{$tel}','{$email}','{$userId}')";
if($mysqli->query($sql)){
	// 添加成功
	echo "<script>location='../index.php?action=infoIndex'</script>";
}else{
	echo "<script>location='../index.php?action=infoAdd'</script>";
}

?>